package com.youkeyi.ddy.cloud.common.api.application.applet.crm.order;

import com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.dto.AppletCustomerOrderDetailCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.dto.AppletCustomerOrderListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.param.AppletCustomerOrderCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.param.AppletCustomerOrderListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.param.AppletCustomerOrderUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.system.user.dto.SystemUserDetailCloudDto;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 客户订单
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"Customer Order management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-APPLET", fallback = AppletCustomerOrderCloudServiceFallback.class)
@RequestMapping("/applet/customer/order")
public interface AppletCustomerOrderCloudService {

    // 查询客户订单列表
    @ApiOperation(value = "Query CustomerOrder List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.AppletCustomerOrderCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = AppletCustomerOrderListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query CustomerOrder List", dataType = "AppletCustomerOrderListCloudParam", dataTypeClass = AppletCustomerOrderListCloudParam.class),
    })
    @GetMapping
    public abstract AppletCustomerOrderListCloudDto list(AppletCustomerOrderListCloudParam param);

    
    // 查询客户订单详情
    @ApiOperation(value = "Query CustomerOrder Detail", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.AppletCustomerOrderCloudService.detail")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemUserDetailCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customerOrderPrimaryKey", paramType = "path", value = "Param of Query CustomerOrder Detail", dataType = "String", dataTypeClass = String.class),
    })
    @GetMapping("/{customerOrderPrimaryKey}")
    public abstract AppletCustomerOrderDetailCloudDto detail(@PathVariable("customerOrderPrimaryKey") String customerOrderPrimaryKey);

    
    // 创建客户订单
    @ApiOperation(value = "Create CustomerOrder", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.AppletCustomerOrderCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create CustomerOrder", dataType = "AppletCustomerOrderCreateCloudParam", dataTypeClass = AppletCustomerOrderCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody AppletCustomerOrderCreateCloudParam param);


    // 编辑客户订单
    @ApiOperation(value = "Update CustomerOrder", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.crm.order.AppletCustomerOrderCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update CustomerOrder", dataType = "AppletCustomerOrderUpdateCloudParam", dataTypeClass = AppletCustomerOrderUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody AppletCustomerOrderUpdateCloudParam param);
    

}
